1. Field of the Invention
The present invention relates generally to systems and methods for multiplexing data streams, and particularly, to a system and method enabling simultaneous real-time pattern searching of multiple logical streams communicated over a shared media.
2. Discussion of the Prior Art
The MPEG-2 Generic Coding of Moving Pictures and Associated Audio: Systems Recommendation H.222.0 ISO/IEC 13818-1 defines the mechanisms for combining, or multiplexing, several types of multimedia information into one program stream. This standard uses a known method of multiplexing, called packet multiplexing, where data, video and audio packets, etc. are interleaved one after other onto a single MPEG-2 transport stream (TS). The individual streams comprising the data, video and audio packets absent system or timing data are called elementary streams. The Packetized Elementary Streams (PES""s) are elementary streams comprising all the header and data required to enable decoding of the elementary stream associated with a programs and may be up to 64 kbytes in length.
Transport Streams (TS""s) are defined for transmission networks and allow for the multiplexing of many Packetized Elementary Streams which are packetized into smaller fixed length size, e.g., 188 bytes. These TS""s additionally may suffer from occasional transmission errors. Each TS packet consists of a TS Header, followed optionally by ancillary data called Adaptation Field, followed typically by some or all the data from one PES packet. The TS Header consists of a greater than Sync13 byte (0xc3x9747), flags, indicators, a Packet Identifier (PID), plus other information used for error detection, timing, etc. The semantics for the MPEG-2 TS header are as follows:
Sync_byte: (8-bits) a fixed value 0xc3x9747.
Transport_error_indicator: (1-bit) Indicates an uncorrectable bit error exists in the current TS packet.
Payload unit13 start13 indicator: (1-bit) indicates the presence of a new PES packet or a new TS-PSI Section. PSIxe2x80x94Program Specific Information.
Transport_priority: (1-bit) indicates a higher priority than other packets.
PID: (13-bits) Values 0 and 1 are pre-assigned, while values 2 to 15 are reserved. Values 0xc3x970010 to 0xc3x971 FFE, may be assigned by the Program Specific Information (PSI). Value 0xc3x971 FFF is used for Null packets.
Transport13 scrambling control: (2-bits) indicates the scrambling mode of the packet payload.
Adaptation_field_control: (2-bits) indicates the presence of adaptation field or payload.
Continuity_counter: (4-bits) One continuity counter per PID. It increments with each non-repeated TS packet having the correspondent PID.
Each MPEG-2 program stream may be characterized as a data stream that is encapsulated using MPEG-2 TS packets, with each packet containing a header field with a packet identifier (PID). The PID field is particularly used by an MPEG-2 transport demultiplexor (xe2x80x9cDemuxxe2x80x9d) to tune to a particular set of PID""s that correspond to a given program stream. Each program stream must have a set of distinct PID""s (except for PID=0xc3x971 FFF for the Null packet).
For example:
program stream 1:  less than video PID=0xc3x97101, audio PID=0xc3x97102, secondary audio PID=0xc3x97107, 0xc3x971 FFF greater than  valid
program stream 2:  less than video PID=0xc3x97101, audio PID=0xc3x97200, private data PID=0xc3x97107, 0xc3x971 FFF greater than  valid
For a typical MPEG-2 transport stream multiplexer, several program streams, originating from different sources (e.g., network interface, or local storage sub-system), are routed over a shared data bus (i.e., a local bus) and stored in a local packet memory. Finally, packets are removed from the packet memory and transmitted over the output channel.
It would be highly desirable to provide for MPEG-2 applications, a mechanism for monitoring the data transfer over the local bus, by parsing the MPEG-2 Transport Layer, removing MPEG-2 TS header and adaptation fields, and searching the payload field, for a specific pattern (e.g., a start code xe2x80x9c0xc3x97000001xe2x80x9d).
U.S. Pat. No. 5,734,429 describes an apparatus for detecting start code for bit stream of compressed image according to the MPEG-standard. The disclosed apparatus however, can only handle the case where only one bit stream is present. Similarly, U.S. Pat. No. 5,727,036 describes a method for searching start code for high bit rate but only covers the case where only one bit stream is present.
It would be desirable to provide a mechanism that searches for patterns in a multi-program multiplexed stream, in real-time, and moreover, that searches in parallel several bit streams that are multiplexed and transmitted over a shared media (bus, network, etc.).
It would be additionally desirable to provide a real-time search mechanism that searches for patterns in a multi-program multiplexed stream, wherein individual bit streams are transferred as buffer (burst-basis) units, and that further provides tracking and transferring of buffer unit context when a search pattern crosses a buffer boundary, i.e., when the starting part of the pattern resides in one buffer and the remainder part resides in a following buffer.
It is an object of the present invention to provide a system and method for performing real-time search of a bit pattern over a shared media supporting multiple simultaneous data streams each associated with a different program source.
It is a further object of the present invention to provide in an MPEG-2 packet Time Division Multiplexed transport system, a real-time data monitoring mechanism for data transfers occurring over a local bus that parses the MPEG-2 Transport Layer, removes MPEG-2 Transport Stream header and adaptation fields, searches the payload field for a specific pattern, and, identifies and indexes points where the search patterns occur.
It is yet another object of the present invention to provide in an MPEG-2 packet transport system, a real-time data monitoring and pattern searching system that additionally tracks all the individual bit streams at a given time, and performs context switching in a transfer unit (burst) basis.
According to the principles of the invention, there is provided a system and method for providing real-time searching and indexing of patterns included in packets of a packet stream over a time-domain multiplexed shared media (e.g., local bus, local area network, etc) and, particularly providing searching of several data streams transmitted over this shared media using a real-time search engine. Given a set of data streams, where a data stream is characterized as a set of linked buffers (initially stored in a Packet Memory (30), for example, using a linked list data structure, and associated with a program stream using a unique identifier called the Queue Identifier (QID)), with each buffer capable of being transferred in blocks of variable block sizes over a shared media using a time-domain multiplexing (TDM) technique (e.g., one block from data stream(i) is transmitted, then one block from data stream(j) is transmitted, and so forth), the real-time search engine is enabled to: capture each individual data transfer; parse the higher level protocol that encapsulates the payload; remove the transport layer header, and perform the pattern searching in the data stream payload. In the event of a pattern being found, the Real-Time Search Engine (100) generates a special status message containing the offset within the packet payload, the location within the associated buffer, and the contents of the packet following the location of the search pattern.
This search is performed in real-time (as the blocks traverse the media), and the search results are reported to a host processor using one or more pre-defined messages. Additionally, as a pattern can cross a buffer boundary, i.e., the starting part of the pattern may reside in one buffer and the remainder part may reside in the subsequent buffer, additional complexity is introduced. The Real-Time Search Engine addresses this complexity by performing a context switching operation which includes: capturing each individual data transfer; mapping a start data transfer address and a data stream identifier (QID) using a buffer number as the key; saving the current contents of a Context Register into an SRAM Context Storage (107); fetching the context corresponding to the new data stream (using the Buffer number as the key); and, copying its contents into the Context Register (105). Once the appropriate context is fetched, the Real-Time Search Engine continues parsing the data stream.
Advantageously, the real-time pattern searching method and system of the invention may be implemented in any transport packet scheme, e.g., IP, ATM, where one or more a data streams are transmitted over a shared media using a time domain multiplexing technique.